﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DevExpress.Xpo;
using Component;

public partial class BackEnd_AdminDisplay_DetailCart_SendMail : System.Web.UI.UserControl
{
    public string _tableCart = "";
    int _IdProdcut = 0;
    string _ContentMail = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        _IdProdcut =ConvertType.ToInt(QueryHelper.GetQueryString(Request, ConstString._id));
        _ContentMail += this.txtTitle.Text+"<p>";
        
        if (_IdProdcut > 0)
        {
            _ContentMail +=Languages.GetContentByLanguage(ProductDB.GetObjectByid(_IdProdcut,false).Description,ProductDB.GetObjectByid(_IdProdcut,false).DescriptionEL);
          
        }
        _ContentMail += "<p>" + this.txtNoteMail.Text+"</p>";
        _ContentMail += "Công ty TNHH Tuyết Lan <br/>Trụ sở chính: 78 Phan Đình Phùng, Phường 8, Quận 5, Tp Hồ Chí Minh. <br/>Điện thoại: 08 8765432 <br/>Fax: 08 8765432 <br/>Email: tuyetlan@co.com <br/>Website: http://keoduatuyetlan.vn;<br/>";
    }
  
    public void SendMail(object sender, EventArgs e)
    {
        string []Mails=this.txtEmail.Text.Split(',');
        if (Component.SendMail.Send(Mails, this.txtTitle.Text, _ContentMail) > 0)
        {
            this.labMessage.Text = "Gửi mail thành công!!!!";
        }
        else
        {
            this.labMessage.Text = "Gửi mail thất bại!!!!";
        }
    }
}
